// JavaScript Document
function conGetAll() {
	$.getJSON(
		"cContract/get_contractlist.php",
		function(json){
			
			$('#Contract .recsbox').html("");
			$('#Contract .recsbox').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="tContract"></table>' );
			$('#tContract').dataTable({	
				"bAutoWidth": true,
				"bStateSave": true,
				"sScrollX": "100%",
				"sScrollXInner": "100%",
				"bScrollCollapse": false,
				"sPaginationType": "full_numbers",
				"aaData":json,
				"aoColumns": [
					{ "sTitle":"ContID"},
					{ "sTitle":"Start"},
					{ "sTitle":"End"},
					{ "sTitle":"EmpFName"},
					{ "sTitle":"EmpLName"},
					{ "sTitle":"Skill"},
					{ "sTitle":"Payment(AUD)"},
					{ "sTitle":"RegDate"}
				],
				"aaSorting": [[ 1, "asc" ]]
			})
			
			$('#tContract tr td').css('cursor','pointer')
				.click(function(){
					clickid= $(this).parent('tr').children('td:eq(0)').html();
					$.getJSON(
						"cContract/get_contract.php?recid="+clickid+ "&" + Date.parse(new Date()),
						function(json){
							viewUI();
							$('#viewbox').css('width','600px');
							bgcoverResize();
							$('#viewbox').append("IssueDate: "+(json.contract[4].split(" "))[0]+"  IssueNumber: RCID"+json.contract[0]+'-'+json.contract[1]+'R'+json.request[0]+json.skill[0]+" IssueBy: WollongongTemp<br /><br />")
.append("<strong>PERSONAL &amp; CONFIDENTIAL</strong><br />")
.append("FullName: "+json.employee[0]+" "+json.employee[1]+"<br />")
.append("Address: "+json.employee[2]+"<br />")
.append(""+json.employee[3]+"<br />")
.append(""+json.employee[4]+"<br />")
.append(""+json.employee[5]+"<br />")
.append("Phone: "+json.employee[6]+"<br />")
.append("Mobile: "+json.employee[7]+"<br />")
.append("Fax: "+json.employee[8]+"<br />")
.append("Email: "+json.employee[9]+"<br />")
.append("RegistDate: "+(json.employee[11].split(" "))[0]+"<br /><br /><br />")
.append("<p><strong>Dear "+json.employee[0]+"</strong>:</p>")
.append("<p>The Wollongong Temp is pleased to offer you employment on the following  terms:</p>")
.append("<p>1.  <strong><em>Rate of pay and benefits</em></strong>: You  will be paid <strong><u>$ "+json.contract[3]+"</u></strong> per hour (hourly pay is for  those whose hours fluctuate per week – casual workers) per month (monthly pay  is for those whose hours remain constant) less applicable deductions.  You will be paid vacation pay entitlement as outlined in the <em>Employment  Standards Act</em>.</p>")
.append("<p>2.  <strong><em>Hours of Work</em></strong>: Your normal  hours of work are 9:00am to 5:00pm, although these hours may vary from  time to time.  ß should be paid monthly</p>")
.append("<p>OR:  Hours of work will be on an on‑call basis where you may elect to work or  not.  Every attempt will be made to offer  hours of work with reasonable advance notice to allow you to make appropriate  arrangements. ← should be paid weekly</p>")
.append("<p>OR:  Hours or work will vary from week to week. You will be notified through posting  of schedules. ß should be paid weekly</p>")
.append("<p>3.  <strong><em>Length of employment</em></strong>: Your  employment will commence on  <strong><u>"+json.request[1]+"</u></strong> and end on  <strong><u>"+json.request[2]+"</u></strong>.  This contract will serve as written notice of  termination. </p>")
.append("<p>4.  <strong>Skill requirement</strong>:  To apply this contract, you are clear that there is a/an <strong><u>"+json.skill[0]+"-"+json.skill[1]+"</u></strong> certification under  your name.</p>")
.append("<p>6.  <strong><em>Obligations</em></strong>:  --------------------------------------------------------------------------------------------------------------------------------------------------------</p>")
.append("<p>Sincerely, <br />")
.append("</p><p></p>")
.append("<p>&nbsp;</p>")
.append("<div stype='border:1px solid #ccc; width:90%; padding:3px;'>I have read and understand  the conditions of the offer of employment set out above and I accept the Wollongong's offer. </div><p>  </p><p>  </p><p>  </p>")
.append("<p>_____________________      _______________________________________<br />")
.append("     DATE                                         SIGNATURE</p>")
					})
				})
		}
	)
}